<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>改变链接-HTML-DOM</title>
		<style type="text/css">
a:active {color:green}
</style>

<script type="text/javascript">
function getfocus()
{document.getElementById('myAnchor').focus()}

function losefocus()
{document.getElementById('myAnchor').blur()}
</script>

	</head>
	<body>
	<a id="myAnchor" href="http://www.w3school.com.cn">访问 W3School.com.cn</a>
<br />
<input type="button" onclick="getfocus()" value="获得焦点" />
<input type="button" onclick="losefocus()" value="失去焦点" />
	</body>
</html>
